//
//  252_会议室.swift
//  Swift-LeetCode
//
//  Created by 卢悦明 on 2024/3/16.
/*
 * 会员题 判断会议是否冲突
 */

import UIKit

class HuiYiShi: NSObject {

    func QA() {
        print(HuiYi([[1,5],[2,7],[3,4]]))
    }
    
    func HuiYi(_ huiArray: [[Int]]) -> Bool {
        if huiArray.count == 0 {
            return true
        }
        var array = huiArray
        array.sort{ $0[0] < $1[0] }
        for i in 1..<array.count {
            if array[i][0] < array[i - 1][1] {
                return false
            }
        }
        return true
    }
}
